package com.szcinda.fitness.utils;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

//编码解码工具
public class EncodeDecodeUtil {

    private static String chartSet = "utf-8";

    public static String encode(String value){
        try {
            return URLEncoder.encode(value, chartSet);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
    }


    public static String decode(String value){
        try {
            return URLDecoder.decode(value, chartSet);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
    }
}
